<?php
    $locations = $this->requestAction(array('controller'=>'jobs','action'=>'by_city'));
    
        echo "<table class='isi_jobs_by'>";
            $i=0;
            foreach($locations as $location)
            {
                if( ($i % $row_number) == 0 )
                { echo "<tr>"; }
                
                echo "<td>".  $html->link($location['cities']['name'], array('controller'=>'jobs','action'=>'search_result','by'=>'location','tid'=>$location['cities']['id'] ) )  ."<span class='info'> (".$location[0]['total'].") </span></td>";
                
                $i++;
                
                if($i==$row_number)
                { $i=0; }
                
                if( ($i % $row_number) == 0 )
                { echo "</tr>"; }

            }
            
            if($i!=0)
            {
                for($j=1;$j<=$row_number-$i;$j++)
                {
                    echo "<td></td>";
                }
                echo "</tr>";
            }
        echo "</table>";
 ?>